home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1225 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  39 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.sprintlink.net!eskimo!news
  3. From: mag@eskimo.com (mAg)
  4. Subject: Re: Bit Masking
  5. X-Nntp-Posting-Host: tia1.eskimo.com
  6. Message-ID: <DL257u.Dnq@eskimo.com>
  7. Sender: news@eskimo.com (News User Id)
  8. Organization: *.*
  9. X-Newsreader: WinVN 0.93.10
  10. References: <DKz5y4.8En@twisto.eng.hou.compaq.com>
  11. Date: Fri, 12 Jan 1996 07:38:18 GMT
  12.  
  13. In article <DKz5y4.8En@twisto.eng.hou.compaq.com> (Wed, 10 Jan 1996 17:06:24 GMT), 
  14. garyc%cs%contractors@bangate.compaq.com says :
  15. >
  16. >Can someone tell me the elegent way to clear specific bits from a
  17. >byte, e.g.
  18. >
  19. ># define BIT_1  1
  20. ># define BIT_2  2
  21. ># define BIT_3  4
  22. ># define BIT_4  8
  23. >
  24. >Set the bit:    x |= BIT_x
  25. >
  26. >Clear the bit using BIT_x:      ????
  27.  
  28. x &= ~BIT_x
  29.  
  30. -- 
  31. /* --------------------------------------------------------
  32.                       MAG@ESKIMO.COM
  33. http://www.eskimo.com/~mag/index.html
  34. ***********************************************************
  35. To understand recursion one must first understand recursion
  36. ***********************************************************
  37. -------------------------------------------------------- */
  38.  
  39.